
//

import Foundation
import UIKit
//global alarm
func pompalert(uvc:UIViewController,message:String)
{
    let alert = UIAlertController(title:"提示",message:message,preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "好", style: .cancel, handler: nil))
    uvc.present(alert, animated: true, completion: nil)
    
}

extension UIImage
{
    func scaleImageToSize(_ size:CGSize)->UIImage
    {
        UIGraphicsBeginImageContextWithOptions(size, false, UIScreen.main.scale)
        self.draw(in: CGRect(x: 0, y: 0, width: size.width, height: size.height))
        let resizeImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()!
        UIGraphicsEndImageContext()
        return resizeImage
    }
    
}
